import Vue from 'vue'
import Router from 'vue-router'
import Login from '../views/Login'
import Main from "../views/Main";
import Profile from '../views/user/Profile'
import List from '../views/user/List'
import NotFound from "../views/NotFound";
Vue.use(Router)
export default new Router({
    mode: 'history',
    routes: [
        {
            //登录页
            path: '/login',
            name: 'Login',
            component: Login
        },
        {
            //首页
            path: '/main',
            name: 'Main',
            component: Main,
            //嵌套路由
            children: [
                {path: '/user/profile/:id', component: Profile,name:'Profile',props:true},
                {path: '/user/list',component: List}
            ]
        },
        {
            path:'*',
            component: NotFound
        }

    ],
})